<template>
  <div class="main">
    <div class="rightone">
      <div class="whcskljc">
        <div
          style="
            display: flex;
            justify-content: space-between;
            align-items: center;
          "
        >
          <div class="title">客源职业统计</div>
          <!-- <div style="display: flex; align-items: center">
            <div class="moren">车场1</div>
            <div class="moren active">车场2</div>
          </div> -->
        </div>
        <div id="whchart10"></div>
      </div>
      <div class="whcg">
        <div
          style="
            display: flex;
            justify-content: space-between;
            align-items: center;
          "
        >
          <div class="title">节假日分析</div>
          <!-- <div style="display: flex; align-items: center">
            <div class="moren">当年</div>
            <div class="moren">当月</div>
            <div class="moren active">当日</div>
          </div> -->
        </div>
        <div id="whchart13"></div>
      </div>
      <div class="whcg">
        <div
          style="
            display: flex;
            justify-content: space-between;
            align-items: center;
          "
        >
          <div class="title">客流量变化趋势</div>
          <div style="display: flex; align-items: center">
            <div class="moren">当年</div>
            <div class="moren">当月</div>
            <div class="moren active">当日</div>
          </div>
        </div>
        <div id="whchart20"></div>
      </div>
    </div>
  </div>
</template>
<script>
import * as echarts from "echarts";
// import "echarts/map/js/china.js";
export default {
  components: {},
  watch: {},
  created() {},
  data() {
    return {
      activeName: "1",
    };
  },
  mounted() {
    this.getdata0();
    this.getdata13();
    this.getdata7();
  },
  methods: {
    getdata7() {
      const chartDom = document.getElementById("whchart20");
      const myChart = echarts.init(chartDom);
      let option;

      option = {
        tooltip: {
          trigger: "axis",
          axisPointer: {
            type: "cross",
            crossStyle: {
              color: "#999",
            },
          },
        },

        legend: {
          textStyle: {
            color: "#fff",
          },
          icon: "circle",
        },
        xAxis: [
          {
            type: "category",
            axisLabel: {
              color: "#fff",
            },
            data: [
              "08:00",
              "10:00",
              "12:00",
              "14:00",
              "16:00",
              "18:00",
              "20:00",
            ],
            axisPointer: {
              type: "shadow",
            },
          },
        ],
        yAxis: [
          {
            type: "value",

            min: 0,
            axisLabel: {
              formatter: "{value} ",
              color: "#fff",
            },
          },
        ],
        series: [
          {
            name: "今日",
            type: "line",
            yAxisIndex: 0,
            color: "#F37170",
            tooltip: {
              valueFormatter: function (value) {
                return value + " °C";
              },
            },
            data: [
              23.0, 16.5, 12.0, 6.2, 2.0, 20.3, 23.4, 2.2, 3.3, 4.5, 6.3, 10.2,
              20.3, 23.4,
            ],
          },
          {
            name: "昨日",
            type: "line",
            yAxisIndex: 0,
            color: "#FFC17C",
            tooltip: {
              valueFormatter: function (value) {
                return value + " °C";
              },
            },
            data: [
              2.0, 2.2, 3.3, 4.5, 6.3, 10.2, 20.3, 23.4, 23.0, 16.5, 12.0, 6.2,
            ],
          },
        ],
      };
      option && myChart.setOption(option);
    },
    getdata0() {
      var color = ["#D9726B", "#244A8B", "#14BED1", "#886EFF", "#089BAB"];
      var seriesData = [
        { name: "自由职业", value: 30 },
        { name: "在职人员", value: 52 },
        { name: "学生", value: 30 },
        { name: "退休人员", value: 23 },
      ];

      const chartDom = document.getElementById("whchart10");
      const myChart = echarts.init(chartDom);
      const option = {
        title: {
          show: true,
          text: "", //可以换行
          x: "49%", // center
          y: "center",
          textAlign: "center",
          textStyle: {
            fontSize: "16",
            fontStyle: "normal",
            fontWeight: "600",
            lineHeight: "28",
            color: "#fff",
          },
        },

        legend: {
          orient: "vertical",
          top: "center",
          right: 0,
          textStyle: {
            align: "left",
            verticalAlign: "middle",
            rich: {
              value: {
                color: color,
                fontSize: 10,
              },
              rate: {
                color: "rgba(255,255,255,0.9)",
                fontSize: 10,
              },
            },
          },
          data: ["自由职业", "在职人员", "学生", "退休人员"],
          formatter: (name) => {
            if (seriesData.length) {
              const item = seriesData.filter((item) => item.name === name)[0];
              return `{name|${name}：}{value| ${item.value}} {rate| ${item.value}%}`;
            }
          },
        },
        tooltip: {
          trigger: "item",
          formatter: "{b} :  {d}%",
        },
        color: color,

        series: [
          {
            type: "pie",
            center: ["35%", "50%"],
            radius: ["25%", "45%"],
            label: {
              normal: {
                show: true,
                color: "#BAE9FF",
              },
              emphasis: {
                show: true,
              },
            },
            labelLine: {
              normal: {
                show: true,
                length: 20,
                length2: 20,
              },
            },
            tooltip: {
              formatter(params) {
                return (
                  params.name +
                  "  " +
                  params.value +
                  "  " +
                  params.percent +
                  "%"
                );
              },
            },
            data: seriesData,
          },
        ],
      };
      myChart.setOption(option);
      window.addEventListener("resize", function () {
        myChart.resize();
      });

      // const chartDom = document.getElementById("whchart10");
      // const myChart = echarts.init(chartDom);
      // let option;

      // option = {
      //   tooltip: {
      //     trigger: "axis",
      //     axisPointer: {
      //       type: "cross",
      //       crossStyle: {
      //         color: "#999",
      //       },
      //     },
      //   },

      //   xAxis: [
      //     {
      //       type: "category",
      //       axisLabel: {
      //         color: "#fff",
      //       },
      //       data: [
      //         "08:00",
      //         "10:00",
      //         "12:00",
      //         "14:00",
      //         "16:00",
      //         "18:00",
      //         "20:00",
      //       ],
      //       axisPointer: {
      //         type: "shadow",
      //       },
      //     },
      //   ],
      //   yAxis: [
      //     {
      //       type: "value",

      //       min: 0,
      //       max: 250,
      //       interval: 50,
      //       axisLabel: {
      //         formatter: "{value} ",
      //         color: "#fff",
      //       },
      //     },
      //     {
      //       type: "value",

      //       min: 0,
      //       max: 25,
      //       interval: 5,
      //       axisLabel: {
      //         formatter: "{value} %",
      //         color: "#fff",
      //       },
      //     },
      //   ],
      //   series: [
      //     {
      //       name: "同比",
      //       type: "line",
      //       yAxisIndex: 1,
      //       color: "#FF7575",
      //       tooltip: {
      //         valueFormatter: function (value) {
      //           return value + " °C";
      //         },
      //       },
      //       data: [
      //         2.0, 2.2, 3.3, 4.5, 6.3, 10.2, 20.3, 23.4, 23.0, 16.5, 12.0, 6.2,
      //       ],
      //     },
      //   ],
      // };
      // option && myChart.setOption(option);
    },

    getdata13() {
      const chartDom = document.getElementById("whchart13");
      const myChart = echarts.init(chartDom);
      let option;

      option = {
        grid: {
          top: "15%",
          bottom: "10%",
          containLabel: true,
        },
        legend: {
          show: true,
          data: ["2023", "2024"],
          textStyle: {
            color: "#fff",
          },
        },
        xAxis: {
          type: "category",
          axisLabel: {
            color: "#fff",
            interval: 0,
          },
          data: ["春节", "元宵节", "端午节", "清明节", "国庆节", "中秋节"],
        },
        yAxis: {
          type: "value",

          nameTextStyle: {
            color: "#fff",
          },
          axisLabel: {
            color: "#fff",
          },
        },
        series: [
          {
            name: "2023",
            data: [120, 200, 150, 80, 70, 110],
            type: "bar",
            barWidth: 17,
            color: "#297bf7",
            itemStyle: {
              normal: {
                color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
                  {
                    offset: 0,
                    color: "rgba(67,134,245, 1)", // 起点颜色
                  },
                  {
                    offset: 1,
                    color: "rgba(67,134,245, 0.7)",
                  },
                ]),
                shadowColor: "rgba(0, 0, 0, 0)",
              },
            },
          },
          {
            name: "2024",
            data: [110, 60, 0, 0, 0, 0],
            type: "bar",
            barWidth: 17,
            color: "#297bf7",
            itemStyle: {
              normal: {
                color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
                  {
                    offset: 0,
                    color: "rgba(42,247,200, 1)", // 起点颜色
                  },
                  {
                    offset: 1,
                    color: "rgba(42,247,200, 0.7)",
                  },
                ]),
                shadowColor: "rgba(0, 0, 0, 0)",
              },
            },
          },
        ],
      };
      option && myChart.setOption(option);
    },
  },
};
</script>
<style scoped>
#whchart20 {
  width: 100%;
  height: 257px;
}
#whchart13 {
  width: 100%;
  height: 257px;
}
#whchart10 {
  width: 100%;
  height: 257px;
}
.ljtitle {
  padding-left: 10px;
  box-sizing: border-box;
  color: #fff;
}
.whcg {
  width: 100%;
  height: 307px;
  margin-top: 17px;
  background: rgba(3, 8, 13, 0.6);
  border-radius: 8px;
  padding: 15px;

  box-sizing: border-box;
}
.whcsimg img {
  width: 100%;
  height: 100%;
}
.whcsnum {
  width: calc(100% - 74px);
  height: auto;
  padding-top: 25px;
  float: left;
  box-sizing: border-box;
}
.whcsimg {
  width: 74px;
  height: 102px;
  float: left;
}
.whcs:nth-child(2n) {
  margin-right: 0px !important;
  margin-bottom: 0px !important;
}
.whcs {
  width: 191px;
  height: 102px;
  margin-right: 5px;
  overflow: hidden;
  float: left;
  padding: 5px;
  box-sizing: border-box;
  background: #0a100c;
  margin-bottom: 10px;
}
.kljclist {
  width: 100%;
  height: auto;
  margin-top: 18px;
  overflow: hidden;
}
.jdrzchart {
  width: 100%;
  height: 237px;
  /* margin-top: 23px; */
}
#jdrzlchart {
  width: 90px;
  height: 90px;
}
.jdtotal {
  width: 137px;
  height: 81px;
  border-radius: 10px;
  line-height: 81px;
  text-align: center;
  font-size: 60px;
  font-weight: bold;
  color: #01ffff;
  background: #1d443b;
}
.jdrzlabel {
  color: #fff;
  text-align: left;
  margin-bottom: 10px;
}
.jdrzlist {
  width: 50%;
  float: left;
  height: auto;
}
.jdrznyum {
  width: 100%;
  height: auto;
  margin-top: 18px;
  overflow: hidden;
}
.jdrzl {
  margin-top: 18px;
  width: 100%;
  height: 404px;
  background: rgba(3, 8, 13, 0.6);
  border-radius: 8px;
  padding: 15px;

  box-sizing: border-box;
}
.whcskljc {
  width: 100%;
  height: 305px;
  background: rgba(3, 8, 13, 0.6);
  border-radius: 8px;
  padding: 15px;

  box-sizing: border-box;
}
.colnum span {
  font-size: 30px;
  font-weight: bold;
  color: #297bf7;
  font-style: italic;
}
.colnum {
  color: #fff;
  font-size: 14px;
  text-align: center;
}
.colltitle {
  text-align: center;
  color: #fff;
}
.colls {
  width: 33.3%;
  height: auto;
  float: left;
}
.collslist {
  margin-top: 32px;
  width: 100%;
  height: auto;
  overflow: hidden;
}
.bhd span {
  color: #01ffff;
}
.bhd {
  position: absolute;
  right: 120px;
}
.jrjq {
  width: 71px;
  height: 25px;
  color: #fff;
  float: right;
  position: absolute;
  background: #2a63e5;
  line-height: 25px;
  right: 25px;
  border-radius: 5px;
  text-align: center;
  background: #2a63e5;
}
.jqgk {
  width: 100%;
  height: 532px;
  background: rgba(3, 8, 13, 0.6);
  border-radius: 8px;
  padding: 15px;

  box-sizing: border-box;
}
.rightone {
  width: 420px;
  height: auto;
  /* float: right; */
}
#oldchart {
  width: 100%;
  height: 161px;
}
#oldchart1 {
  width: 100%;
  height: 141px;
}
.yknlcf {
  margin-top: 10px;
  text-align: left;
  color: #fff;
}
#yklytjchart {
  width: 100%;
  height: 316px;
}
.ykcftj {
  color: #fff;
  text-align: left;
  margin-top: 45px;
}
.yqtitle {
  font-size: 10px;
  margin-top: -37px;
  text-align: center;
  color: #eff0ef;
}
.yqpie {
  width: 100%;
  height: 100px;
}
.yqpxlb {
  width: 100%;
  height: auto;
  display: flex;
  justify-content: space-around;
}
.yqxlln {
  width: 33.3%;
  height: auto;
}
.ykcf {
  width: 100%;
  height: 405px;
  background: rgba(3, 8, 13, 0.6);
  border-radius: 8px;
  padding: 15px;
  margin-top: 16px;
  box-sizing: border-box;
}
.kytj {
  width: 100%;
  height: 533px;
  background: rgba(3, 8, 13, 0.6);
  border-radius: 8px;
  padding: 15px;
  box-sizing: border-box;
}
.lefttwo {
  width: 420px;
  height: auto;
  float: left;
  margin-left: 19px;
}
.ndimg img {
  width: 100%;
  height: 100%;
}
.ndimg {
  width: 100%;
  height: 94px;
}
.ndklfx {
  margin-top: 18px;
  margin-bottom: 10px;
  color: #fff;
}
.jcmapright div img {
  vertical-align: middle;
}
.jcmapright div {
  color: #fff;
}
.jcmapright {
  width: 40%;
  float: left;
}
.jcnum {
  display: inline-block;
  color: #fff;
}
.jcnum span {
  font-size: 20px;
  color: #4af3ff !important;
  font-weight: bold;
  font-style: italic;
}
.jcmapleft {
  width: 60%;
  height: auto;
  float: left;
}
.jcmap {
  width: 100%;
  height: auto;
  overflow: hidden;
  margin-top: 7px;
}
.kljc1 {
  margin-top: 15px;
  width: 100%;
  height: 521px;
  background: rgba(3, 8, 13, 0.6);
  border-radius: 8px;
  padding: 15px;
  box-sizing: border-box;
}

.numm1 {
  width: 50%;
  float: left;
}
.label {
  color: #fff;
  text-align: left;
}
.value span {
  font-size: 20px;
  color: #297bf7 !important;
  font-weight: bold;
  font-style: italic;
}
.value {
  color: #fff;
  text-align: left;
  margin-top: 5px;
}
.value1 span {
  font-size: 20px;
  color: #ff7d4a !important;
  font-weight: bold;
  font-style: italic;
}
.value1 {
  color: #fff;
  text-align: left;
  margin-top: 5px;
}
.numm {
  width: 100%;
  height: auto;
  margin-top: 16px;
  overflow: hidden;
}
.ryall span {
  font-size: 20px;
  color: #3abac0 !important;
  font-weight: bold;
  font-style: italic;
}
.ryall {
  margin-top: 25px;
  color: #fff;
}
.kljc {
  width: 100%;
  height: 419px;
  background: rgba(3, 8, 13, 0.6);
  border-radius: 8px;
  padding: 15px;
  box-sizing: border-box;
}
.leftone {
  width: 419px;
  height: auto;
  float: left;
}
.main {
  position: absolute;
  right: 22px;
  top: 90px;
  width: 420px;
}
.leftBxo {
  width: 23%;
  display: flex;
}

.rightBxo {
  width: 23%;
  display: flex;
}
.title {
  font-size: 24px;
  font-family: YouSheBiaoTiHei, YouSheBiaoTiHei-Regular;
  font-weight: 600;
  text-align: left;
  font-style: italic;
  color: #ffffff;
}
</style>
<style>
.collapseZdy .el-collapse-item__header {
  background-color: rgba(1, 255, 255, 0.16);
  border-radius: 3px 3px 0px 0px;
  font-size: 14px;
  font-family: Source Han Sans SC, Source Han Sans SC-Regular;
  font-weight: 400;
  text-align: left;
  color: #ffffff;
  padding-left: 6px;
  border-bottom: 3px solid #01ffff;
  position: relative;
  margin-bottom: 10px;
}
.collapseZdy {
  border-top: 1px solid transparent;
  border-bottom: 1px solid transparent;
}
.collapseZdy .el-collapse-item__wrap {
  background-color: transparent !important;
  border-bottom: none !important;
  color: #fff !important;
}
.collapseZdy .el-collapse-item__content {
  color: #fff !important;
  padding-bottom: 0;
}
.moren {
  padding: 6px 8px;
  height: 14px;
  background: rgba(255, 255, 255, 0.15);
  border: 0.5px solid #47b2b5;
  border-radius: 3px;
  box-shadow: 0px 1.5px 3px 0px rgba(0, 0, 0, 0.16);
  backdrop-filter: blur(15px);
  font-size: 12px;
  font-family: AlibabaPuHuiTi-Regular;
  font-weight: normal;
  text-align: center;
  color: #ffffff;
  line-height: 14px;
  margin-left: 10px;
}
.active {
  background: #47b2b5;
  border: 1px solid #47b2b5;
  border-radius: 3px;
  box-shadow: 0px 1.5px 3px 0px rgba(0, 0, 0, 0.16);
  backdrop-filter: blur(15px);
}
</style>
